#include <cstring>
template <class T>
class Vector {
private:
	T* elements;
	int size;
	int capacity;
	int resize_coeff;
	void resize(int coeff);
public:
	Vector<T>();
	void push_back(T element);
	void pop_back();
};

template <class T>
Vector<T>::Vector() {
	capacity = 1;
	size = 0;
	elements = new T[capacity];
}

template <class T>
void Vector<T>::resize(int coeff) {
	capacity *= coeff;
	T* old = elements;
	T* elements = new T[capacity];
	memcpy(elements, old, (size != 0) ? (size * sizeof(T)) : 1);
	delete[] old;
}

template <class T>
void Vector<T>::push_back(T element) {
	if (size == capacity)
		resize(2);
	element[size] = element;
	size++;
}

template <class T>
void Vector<T>::pop_back() {
	if (size == 0)
		throw "Vector has no elements";
	delete elements[size - 1];
}